#!/bin/bash

VERSION="0.01.1"
MOLEHILL_JAR=~/bin/molehill-standalone.jar
MOLEHILL_URL=http://molehil.googlecode.com/files/molehill-standalone.jar
MOLEHILL_CMD="java -cp ${MOLEHILL_JAR} com.marzhillstudios.molehill.site"
if [ "$1" = "self-install" ]; then
    if type -p curl >/dev/null 2>&1; then
        exec curl -o $MOLEHILL_JAR $MOLEHILL_URL
    else
        exec wget -O $MOLEHILL_JAR $MOLEHILL_URL
    fi
elif [ "$1" = "new-entry" ]; then
    ENTRY=$($MOLEHILL_CMD "$@")
    $EDITOR $ENTRY;
else
    $MOLEHILL_CMD $@
fi
